package com.ssm.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.ssm.entity.Book;
import com.ssm.service.BookService;

@Controller
@RequestMapping("/book") // url:/模块/资源/{id}/细分/seckill/list
public class BookController {
	@Autowired
	private BookService bookService;

	@RequestMapping(value = "/list", method = RequestMethod.GET)
	private ModelAndView list(ModelAndView mv) {
		List<Book> list = bookService.getList();
		mv.addObject("list", list);
		mv.setViewName("list");
		return mv;
	}
}
